package Sta;
import java.util.Scanner;
public class LX {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请选择商品：1.苹果 2.香蕉 3.梨 4.橘子 5.菠萝");
        int num = scan.nextInt();

            int money=0;
            switch (num){
                case 1:
                    System.out.println("苹果");
                    money+=250;
                    break;

                case 2:
                    System.out.println("香蕉");
                    money+=380;
                    break;
                case 3:
                    System.out.println("梨");
                    money+=110;
                    break;
                case 4:
                    System.out.println("橘子");
                    money+=420;
                    break;
                case 5:
                    System.out.println("菠萝");
                    money+=100;
                    break;
                default:
                    System.out.println(0);
            }
            //System.out.println(money);
        System.out.println("请输入商品数量");

        int count=scan.nextInt();
        money=count*money;
            if (money>=500){
                money*=0.5;
            }else if(money>200){
                money*=0.8;
            }else{
                money=money;
            }
        System.out.println(money);
        //int money1=num*count;

        System.out.println("您购买的是："+num+" 数量："+count+" 总价格："+money);
        System.out.println("请输入付款金额");

        int JE=scan.nextInt();

        if (JE<money) {

            System.out.println("金额不足");

        }else {

            System.out.println(" 总价格："+money+ "你的付款金额："+JE+" 找零："+(JE-money)+"元");

            System.out.println("谢谢惠顾，欢迎下次光临");

        }

    }
}
